package com.yunhe.device.service.base;

import com.yunhe.common.exception.ArgumentErrorException;
import com.yunhe.common.exception.ObjectNotFoundException;
import com.yunhe.common.exception.UniqueConstraintsException;
import com.yunhe.device.domain.base.EquipmentAttributes;
import com.yunhe.device.model.base.EquipmentAttributesQueryCondition;
import com.yunhe.device.model.base.EquipmentAttributesVo;
import com.yunhe.device.model.base.StatusVo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName EquipmentAttributeService
 * @Description TODO
 * @Author HeTao
 * @Date 2021/7/15 12:39
 * @Version 1.0
 **/
public interface EquipmentAttributeService {

    /**
     * 新增设备属性
     * @param equipmentAttributes
     * @return
     * @throws ObjectNotFoundException
     * @throws UniqueConstraintsException
     * @throws ArgumentErrorException
     */
    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    EquipmentAttributes createEquipmentAttributes(EquipmentAttributes equipmentAttributes) throws ObjectNotFoundException, UniqueConstraintsException, ArgumentErrorException;

    /**
     * 查询设备属性列表
     * @param equipmentAttributesQueryCondition
     * @return
     */
    Iterable<EquipmentAttributesVo> getEquipmentAttributesByCondition(EquipmentAttributesQueryCondition equipmentAttributesQueryCondition);

    /**
     * 查询设备属性详情
     * @param id
     * @return
     * @throws ObjectNotFoundException
     */
    EquipmentAttributesVo getEquipmentAttributesById(Long id) throws ObjectNotFoundException;

    /**
     * 根据id删除设备属性
     * @param id
     * @throws ObjectNotFoundException
     * @throws ArgumentErrorException
     */
    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    void deleteEquipmentAttributesById(Long id) throws ObjectNotFoundException, ArgumentErrorException;

    /**
     * 修改设备属性信息
     * @param equipmentAttributes
     * @return
     * @throws ObjectNotFoundException
     * @throws UniqueConstraintsException
     * @throws ArgumentErrorException
     */
    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    EquipmentAttributes updateEquipmentAttributes(EquipmentAttributes equipmentAttributes) throws ObjectNotFoundException, UniqueConstraintsException, ArgumentErrorException;

    /**
     * 设备属性禁用恢复
     *
     * @param statusVo@return
     * @throws ObjectNotFoundException
     * @throws UniqueConstraintsException
     * @throws ArgumentErrorException
     */
    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    void updateEquipmentAttributesStauts(StatusVo statusVo) throws ObjectNotFoundException, UniqueConstraintsException, ArgumentErrorException;

    /**
     * 根据设备类型查询设备属性列表
     * @param equipName
     * @return
     */
    List<EquipmentAttributes> getEquipmentAttributesByEquipTypeName(String equipName);

    /**
     * 根据设备类型查询设备属性
     * @param id
     * @return
     */
    List<EquipmentAttributesVo> getEquipmentAttributesByEquipTypeId(Long id);

    List<Long> getEquipmentAttributesByName(List<String> asList);
}
